#include "../source/Server_version1.hpp"
#include <string>
int main()
{
    std::string ip = "127.0.0.1";
    u_int16_t port = 9999;

    muduo::Socket cli_socket;
    cli_socket.CreateClient(port, ip);

    std::string msg = "hello world";
    cli_socket.Send((void *)msg.c_str(), msg.size());

    char buffer[1024];
    bzero(buffer, sizeof(buffer));
    int n = cli_socket.Recv(buffer, sizeof(buffer) - 1);
    std::cout << "客户端收到信息了" << std::endl;
    buffer[n] = 0;
    DBG_LOG("echo: %s", buffer);
    while (1)
    {
        sleep(1);
        INF_LOG("客户端还在");
    }
    cli_socket.Close();
}